/**
 * @file common.h
 * @author HaoyuWang (136046355@qq.com)
 * @brief 通用常量配置
 * @version 0.1
 * @date 2025-01-25
 * 
 * @copyright Copyright (c) 2025
 * 
 */

#ifndef __COMMON_H__
#define __COMMON_H__


#include <string>

namespace common{
    const int WORKER_NUM = 4;
    const int BUFF_LEN = 65535;
    const int HEAD_LEN = 2;
    const int READ_BUFF_LEN = 65535 - HEAD_LEN;
    const int WRITE_BUFF_LEN = 512;

    const int PROTO_HEADER_SIZE_INDEX = 0;
    const int PROTO_HEADER_CMD_INDEX = 2;
    const int PROTO_HEADER_LEN = 4;
    const int PROTO_BUFFER_LEN = 65535;
    const int PROTO_HEAD_CMD_LEN = 2;

    const std::string LOG_NAME = "log";

    const int MAXLINE = 4096;
    const int SERVER_PORT = 8001;
    const std::string SERVER_ADDR = "127.0.0.1";

    const int CONSOLE_PORT = 10001;
    const std::string CONSOLE_ADDR = "127.0.0.1";

    const int STATUS_SUCCESS = 1;
    const int STATUS_FAILED = -1;
}

enum EDirection{
    DIRECTION_START = 0,
    DIRECTION_UP = 1,
    DIRECTION_DOWN = 2,
    DIRECTION_LEFT = 3,
    DIRECTION_RIGHT = 4,
    DIRECTION_END = 5,
};


#endif  // __COMMON_H__